<template>
    <div>
      <h2>父组件的变量是一个String类型（username)，并且有默认值</h2>
      <h2>父向子组件传值：{{username}}</h2>
      <button @click="username = Math.random()">修改父组件的值</button>
      <div style="background: #ccddff">
        <h3>这是子组件区域</h3>
        <demo01-children username="username"></demo01-children>
        <demo01-children :username="username"></demo01-children>
      </div>
    </div>
</template>

<script>
import Demo01Children from './demo01-children.vue'
export default {
  name: 'demo01',
  components: {
    Demo01Children
  },
  data () {
    return {
      username: '张三'
    }
  }
}
</script>

<style scoped>

</style>
